package com.neusoft.demo.controller;


import com.neusoft.demo.pojo.Bumen;
import com.neusoft.demo.pojo.Yuangong;
import com.neusoft.demo.server.BumenServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@CrossOrigin
@Controller
@RequestMapping("/bumen")
public class DeptController {
    @Autowired
    BumenServer bumenServer;
    @ResponseBody
    @RequestMapping("/list")
    public java.util.List<Bumen> bumenList(){
        return bumenServer.bumenList();
    }
    @ResponseBody
    @RequestMapping("/saveBumen")
    public boolean saveBumen(Bumen bumen){

        return  bumenServer.updateBumen(bumen);
    }
    @ResponseBody
    @RequestMapping("/delBumen")
    public  boolean delBumen(int id){

        return bumenServer.delBumen(id);
    }
    @ResponseBody
    @RequestMapping("/addBumen")
    public boolean addBumen(Bumen bumen){

        return  bumenServer.addBumen(bumen);
    }
    @ResponseBody
    @RequestMapping("/search")
    public java.util.List<Bumen> bumenSearch(String bname,String badress){
        return bumenServer.bumenSearch(bname,badress);
    }
}
